package net.learn.piggy.processor;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;

public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor {
    @Override
    public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
        String[] activeProfiles = environment.getActiveProfiles();
        if(activeProfiles.length==0){
            application.setAdditionalProfiles("dev");
        }
        System.out.println("MyEnvironmentPostProcessor --> postProcessEnvironment");
    }
}
